package com.family.menage.controller;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.family.menage.entity.DevelopersEntity;
import com.family.menage.service.DevelopersService;
import com.family.common.utils.PageUtils;
import com.family.common.utils.R;



/**
 * 
 * 房地产管理
 * @author Qzy
 * @email 2434785870@qq.com
 * @date 2021-09-16 10:28:55
 */
@RestController
@RequestMapping("menage/developers")
public class DevelopersController {
    @Autowired
    private DevelopersService developersService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public List<DevelopersEntity> list(@RequestBody DevelopersEntity developersEntity) {
        return developersService.findAll(developersEntity);
    }


    /**
     * 信息
     */
    @RequestMapping("//{id}")
    public R info(@PathVariable("id") Integer id){
		DevelopersEntity developers = developersService.getById(id);

        return R.ok().put("developers", developers);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody DevelopersEntity developers){
		developersService.save(developers);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody DevelopersEntity developers){
		developersService.updateById(developers);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
		developersService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
